package com.canaan.business.mapper.bill;

import java.util.List;

import com.canaan.business.domain.bill.TrayDetail;
import com.canaan.business.domain.vo.OutStockQueryVo;
import org.apache.ibatis.annotations.Param;

/**
 * 托盘明细Mapper接口
 *
 * @author canaan
 * @date 2025-03-28
 */
public interface TrayDetailMapper {
    /**
     * 查询托盘明细
     *
     * @param id 托盘明细主键
     * @return 托盘明细
     */
    public TrayDetail selectTrayDetailById(Long id);

    /**
     * 查询托盘明细列表
     *
     * @param trayDetail 托盘明细
     * @return 托盘明细集合
     */
    public List<TrayDetail> selectTrayDetailList(TrayDetail trayDetail);

    /**
     * 新增托盘明细
     *
     * @param trayDetail 托盘明细
     * @return 结果
     */
    public int insertTrayDetail(TrayDetail trayDetail);

    /**
     * 批量新增托盘明细
     *
     * @param trayDetailList 托盘明细列表
     * @return 结果
     */
    public int batchInsertTrayDetail(List<TrayDetail> trayDetailList);

    /**
     * 修改托盘明细
     *
     * @param trayDetail 托盘明细
     * @return 结果
     */
    public int updateTrayDetail(TrayDetail trayDetail);

    /**
     * 批量修改托盘明细
     *
     * @param trayDetailList 托盘明细列表
     * @return 结果
     */
    public int batchUpdateTrayDetail(List<TrayDetail> trayDetailList);

    /**
     * 删除托盘明细
     *
     * @param id 托盘明细主键
     * @return 结果
     */
    public int deleteTrayDetailById(Long id);

    /**
     * 批量删除托盘明细
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTrayDetailByIds(Long[] ids);

    /**
     * 根据托盘号删除明细
     *
     * @param trayNo
     * @return
     */
    public int deleteTrayDetailByTrayNo(String trayNo);

    /**
     * 根据托盘号、物料编码、批次删除明细
     *
     * @param trayNo
     * @return
     */
    public int deleteTrayDetailByTrayNoProdNoBatch(@Param("trayNo") String trayNo, @Param("productNo") String productNo, @Param("batchNo") String batchNo);

    /**
     * 查询托盘明细
     *
     * @param trayDetail 托盘明细
     * @return 托盘明细集合
     */
    public List<TrayDetail> selectTrayDetails(TrayDetail trayDetail);

    List<TrayDetail> selectTrayDetailsByOutStockQueryVo(OutStockQueryVo outStockQueryVo);
}
